﻿@model DistanceLearning.Models.ExamTestQuestion

@{
    ViewBag.Title = "OpenQuestion";
}

<b>
    @Model.Body
</b>

@{
    foreach(var tPicture in Model.ExamTestPictures)
    {
        string imagePath = string.Format("Image/{0}", tPicture.ExamTestPictureID);
        <img src=@imagePath alt="name" /><br />
    }
}

<h4>Варианты ответов:</h4>
@using (Html.BeginForm())
{
    @Html.HiddenFor(x => x.ExamTestQuestionID);
    <fieldset>
    @{
        //foreach (var answer in Model.ExamTestVariants)
        for (int i = 0; i < Model.ExamTestVariants.Count; ++i)
        {
            if (Model.AllowMultiAnswer)
            {
            @*@Html.CheckBox("correct") @answer.VariantText*@
                <input type="checkbox" name="correct" value=@i />
                @Model.ExamTestVariants[i].VariantText<br />
            }
            else
            {
                <input type="radio" name="correct" value=@i />
                @Model.ExamTestVariants[i].VariantText<br />
            @*Html.RadioButtonFor(x => x.UserVariant, answer.VariantText) @answer.VariantText<br />*@
            }
        }
    }
    </fieldset>
    <p>
        <input type="submit" value="Ответить" />
    </p>
}